﻿using System;
using System.Collections.Generic;
using System.Text;

namespace 构造函数
{
    class Book1
    {
        public Book1(int Id, string Title, int Price)
        {
            Console.WriteLine("Book1中的构造函数被调用了");
            _id = Id;
            _title = Title;
            _price = Price;
            Console.WriteLine("书本Id:{0} 书名:{1} 书本价格:{2}", Id, Title, Price);
        }
        private int _id;
        private string _title;
        private int _price;

        public int Id
        {
            get { return _id; }
            set { _id = value; }
        }
        public string Title
        {
            get { return _title; }
            set { _title = value; }
        }
        public int Price
        {
            get { return _price; }
            set { _price = value; }
        }

        //public void BookInformation(int Id, string Title, int Price)
        //{
        //    Console.WriteLine("书本Id:{0} 书名:{1} 书本价格:{2}", Id, Title, Price);
        //}

    }
}
